<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>systemc.c</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (SystemC) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#27ae60;">#include </span><span style="color:#27ae60;">&quot;systemc.h&quot;</span>

<span style="color:#7a7c7d;">/*</span>
<span style="color:#7a7c7d;"> multi line comment</span>
<span style="color:#7a7c7d;"> */</span>

<span style="color:#7a7c7d;">// declare some module</span>
<span style="color:#0095ff;font-weight:bold;">SC_MODULE</span>(gate)
{
    <span style="color:#7a7c7d;">// inputs</span>
    <span style="color:#2980b9;">sc_in</span>&lt;<span style="color:#2980b9;">bool</span>&gt; inA, inB;

    <span style="color:#7a7c7d;">// outputs</span>
    <span style="color:#2980b9;">sc_out</span>&lt;<span style="color:#2980b9;">bool</span>&gt; out;

    <span style="color:#7a7c7d;">// C function</span>
    <span style="color:#2980b9;">void</span> do_something()
    {
        out.write(inA.read() || inB.read());
    }

    <span style="color:#7a7c7d;">// constructor</span>
    <span style="color:#0095ff;font-weight:bold;">SC_CTOR</span>(gate)
    {
        <span style="color:#7a7c7d;">// register method</span>
        <span style="color:#0095ff;font-weight:bold;">SC_METHOD</span>(do_something);
    }
};
</pre></body></html>
